a = int(input())
n = 3
s = 0
q = 1
while a > s:
    n += 1
    s = (n + 2) * (n - 1) / 2

ad = s - a
if ad == 0:
    print(" ".join(str(i) for i in range(2, n+1)))
    for i in range(2, n+1):
        q = q * i
    print(q)
elif ad == 1:
    print(" ".join(str(i) for i in range(3, n+2)))
    for i in range(3, n+2):
        q = q * i
    print(q)
elif ad > 1:
    ret = [i for i in range(2, n+1) if i != ad]
    print(" ".join(str(i) for i in ret))
    for i in ret:
        q = q * i
    print(q)
